package leetcode_701_800;

public class LeeCode_704 {
    public static void main(String[] args) {

    }
    private static int search(int[] nums, int target) {
        int l = 0, r = nums.length - 1;
        while (l < r){
            int m = l + (r - l) / 2;
            if (nums[m] < target){
                l = m + 1;
            }else if (nums[m] > target){
                r = m - 1;
            }else {
                l = m;
                r = m;
            }
        }
        if (nums[l] == target)
            return l;
        return -1;
    }
}
